// 左右
<template>
<p>您可以将菜单项放置在左边或右边。</p>
  <el-menu
    :default-active="activeIndex"
    class="el-menu-demo"
    mode="horizontal"
    :ellipsis="false"
    @select="handleSelectVar"
  >
    <el-menu-item index="0">
      <!-- <img
        style="width: 100px"
        src="/images/element-plus-logo.svg"
        alt="Element logo"
      /> -->
      <el-icon><Search /></el-icon>
    </el-menu-item>
    <el-menu-item index="1">Processing Center</el-menu-item>
    <el-sub-menu index="2">
      <template #title>Workspace</template>
      <el-menu-item index="2-1">item one</el-menu-item>
      <el-menu-item index="2-2">item two</el-menu-item>
      <el-menu-item index="2-3">item three</el-menu-item>
      <el-sub-menu index="2-4">
        <template #title>item four</template>
        <el-menu-item index="2-4-1">item one</el-menu-item>
        <el-menu-item index="2-4-2">item two</el-menu-item>
        <el-menu-item index="2-4-3">item three</el-menu-item>
      </el-sub-menu>
    </el-sub-menu>
  </el-menu>
</template>

<script lang="ts" setup>
import { ref } from 'vue'

const activeIndex = ref('1')
const handleSelectVar = (key: string, keyPath: string[]) => {
  console.log(key, keyPath)
}
</script>


<style>
.el-menu--horizontal > .el-menu-item:nth-child(1) {
  margin-right: auto;
}
</style>

<style scoped>
@import '../../assets/elementPlusDemo.css'
</style>